/*
 * Copyright (c) 2017,重庆阿莫比科技有限公司,All Rights Reserved.
 */
package com.wowocai.btchina.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <br/>
 * Date: 2017年3月16日 下午9:14:16 <br/>
 * 
 * @Author 刘建成
 * @Version
 */
public class WebTorrentEntity implements Serializable {

    /**
     * serialVersionUID:TODO<br/>
     */
    private static final long serialVersionUID = 5005889467367944197L;

    // public static final String TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";

    public String _id, infohash, magnet, name, humanSize, createDate, lastUpdate, orname;

    public Date createTime;

    public long size;

    public boolean isVideo;

    public List<WebTorrentFileEntity> files;

    public List<String> keys;

    public int visitCount;

    /**
     * Creates a new instance of WebTorrentEntity.
     */
    public WebTorrentEntity() {
        super();
    }

    /**
     * infohash.
     * 
     * @return the infohash
     */

    public String getInfohash() {
        return infohash;
    }

    /**
     * infohash.
     * 
     * @param infohash the infohash to set
     * @return
     */

    public WebTorrentEntity setInfohash(String infohash) {
        this.infohash = infohash;
        return this;
    }

    /**
     * magnet.
     * 
     * @return the magnet
     */

    public String getMagnet() {
        return magnet;
    }

    /**
     * magnet.
     * 
     * @param magnet the magnet to set
     * @return
     */

    public WebTorrentEntity setMagnet(String magnet) {
        this.magnet = magnet;
        return this;
    }

    /**
     * name.
     * 
     * @return the name
     */

    public String getName() {
        return name;
    }

    /**
     * name.
     * 
     * @param name the name to set
     * @return
     */

    public WebTorrentEntity setName(String name) {
        this.name = name;
        return this;
    }

    /**
     * humanSize.
     * 
     * @return the humanSize
     */

    public String getHumanSize() {
        return humanSize;
    }

    /**
     * humanSize.
     * 
     * @param humanSize the humanSize to set
     * @return
     */

    public WebTorrentEntity setHumanSize(String humanSize) {
        this.humanSize = humanSize;
        return this;
    }

    /**
     * createDate.
     * 
     * @return the createDate
     */

    public String getCreateDate() {
        return createDate;
    }

    /**
     * createDate.
     * 
     * @param createDate the createDate to set
     * @return
     */

    public WebTorrentEntity setCreateDate(String createDate) {
        this.createDate = createDate;
        return this;
    }

    /**
     * lastUpdate.
     * 
     * @return the lastUpdate
     */

    public String getLastUpdate() {
        return lastUpdate;
    }

    /**
     * lastUpdate.
     * 
     * @param lastUpdate the lastUpdate to set
     * @return
     */

    public WebTorrentEntity setLastUpdate(String lastUpdate) {
        this.lastUpdate = lastUpdate;
        return this;
    }

    /**
     * createTime.
     * 
     * @return the createTime
     */

    public Date getCreateTime() {
        return createTime;
    }

    /**
     * createTime.
     * 
     * @param createTime the createTime to set
     * @return
     */

    public WebTorrentEntity setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }

    /**
     * size.
     * 
     * @return the size
     */

    public long getSize() {
        return size;
    }

    /**
     * size.
     * 
     * @param size the size to set
     * @return
     */

    public WebTorrentEntity setSize(long size) {
        this.size = size;
        return this;
    }

    /**
     * isVideo.
     * 
     * @return the isVideo
     */

    public boolean isVideo() {
        return isVideo;
    }

    /**
     * isVideo.
     * 
     * @param isVideo the isVideo to set
     * @return
     */

    public WebTorrentEntity setVideo(boolean isVideo) {
        this.isVideo = isVideo;
        return this;
    }

    /**
     * files.
     * 
     * @return the files
     */

    public List<WebTorrentFileEntity> getFiles() {
        return files;
    }

    /**
     * files.
     * 
     * @param files the files to set
     * @return
     */

    public WebTorrentEntity setFiles(List<WebTorrentFileEntity> files) {
        this.files = files;
        return this;
    }

    // /**
    // * TODO The function of this method is described here - Optional.
    // *
    // * @see java.lang.Object#toString()
    // */
    // public String toEsString() {
    // StringBuilder builder = new StringBuilder();
    // builder.append("{\"infohash\":\"");
    // builder.append(infohash);
    // builder.append("\",\"magnet\":\"");
    // builder.append(magnet);
    // builder.append("\",\"name\":\"");
    // builder.append(name);
    // builder.append("\",\"humanSize\":\"");
    // builder.append(humanSize);
    // builder.append("\",\"createDate\":\"");
    // builder.append(createDate);
    // builder.append("\",\"lastUpdate\":\"");
    // builder.append(lastUpdate);
    // builder.append("\",\"createTime\":\"");
    // builder.append(TimeUtils.format(createTime, TIME_FORMAT));
    // builder.append("\",\"visitCount\":");
    // builder.append(visitCount);
    // builder.append(",\"size\":");
    // builder.append(size);
    // builder.append(",\"isVideo\":");
    // builder.append(isVideo);
    // builder.append("}");
    // return builder.toString();
    // }

    // public static void main(String[] args) {
    // WebTorrentEntity en = new WebTorrentEntity();
    // en.name = "\"2452452\"";
    // System.out.println(en.toEsString());
    // }

    /**
     * visitCount.
     * 
     * @return the visitCount
     */

    public int getVisitCount() {
        return visitCount;
    }

    /**
     * visitCount.
     * 
     * @param visitCount the visitCount to set
     * @return
     */

    public WebTorrentEntity setVisitCount(int visitCount) {
        this.visitCount = visitCount;
        return this;
    }

    /**
     * _id.
     * 
     * @return the _id
     */

    public String get_id() {
        return _id;
    }

    /**
     * _id.
     * 
     * @param _id the _id to set
     */

    public WebTorrentEntity set_id(String _id) {
        this._id = _id;
        return this;
    }

    /**
     * orname.
     * 
     * @return the orname
     */

    public String getOrname() {
        return orname;
    }

    /**
     * orname.
     * 
     * @param orname the orname to set
     * @return
     */

    public WebTorrentEntity setOrname(String orname) {
        this.orname = orname;
        return this;
    }

    /**
     * keys.
     * 
     * @return the keys
     */

    public List<String> getKeys() {
        return keys;
    }

    /**
     * keys.
     * 
     * @param keys the keys to set
     */

    public void setKeys(List<String> keys) {
        this.keys = keys;
    }

    // "_id" : "80cb80092b913441346c55c7bb029840a6da0065",
    // "infohash" : "80cb80092b913441346c55c7bb029840a6da0065",
    // "magnet" : "magnet:?xt=urn:btih:80cb80092b913441346c55c7bb029840a6da0065",
    // "name" : "[AgusiQ-TorrentS.pl] Somnus.2016.PL.SUB.480p.WEB-DL.XviD.AC3-KiT [jans12]",
    // "size" : 1521965541,
    // "humanSize" : "1.4 GB",
    // "visitCount" : 6,
    // "isVideo" : true,
    // "address" : "93.105.29.214",
    // "port" : 60480,
    // "files" : [
    // {
    // "hsize" : "1.4 GB",
    // "size" : 1520261120,
    // "file" : "Somnus.2016.PL.SUBBED.480p.WEB-DL.XviD.AC3-KiT.avi"
    // },
    // {
    // "hsize" : "1.6 MB",
    // "size" : 1700262,
    // "file" : "AgusiQ.gif"
    // },
    // {
    // "hsize" : "3.9 KB",
    // "size" : 4034,
    // "file" : "Torrent downloaded from agusiq-torrents.pl upload jans12.txt"
    // },
    // {
    // "hsize" : "125 B",
    // "size" : 125,
    // "file" : "AgusiQ Zaprasza.url"
    // }
    // ],
    // "createDate" : "2017-03-14",
    // "lastUpdate" : "2017-03-14",
    // "createTime" : ISODate("2017-03-13T18:36:15.000Z"),

}
